<?
	include("koneksi.php");
	$nrp=$_GET['nrp'];
	$kode=$_GET['kode_mk'];
	$queri5=mysql_query("select count(*) from registrasi where nrp='$nrp' and kodemk='$kode'");
	$row5=mysql_fetch_row($queri5);
	//echo "$row5[0]";
	
	if($row5[0] == 1)
	{
		$queri=mysql_query("delete from registrasi where nrp='$nrp' and kodemk='$kode'");
		$queri2=mysql_query("select sks from mk where kodemk='$kode'");
		$row2=mysql_fetch_row($queri2);
		if($queri)
		{
			$queri3=mysql_query("select sks from security where username='$nrp'");
			$row3=mysql_fetch_row($queri3);
			$sks = $row3[0]+$row2[0];
			$queri4=mysql_query("update security set sks='$sks' where username='$nrp'");
			echo "Sukses";
		}
		else
		{
			echo "Gagal";
		}
	}
	else
	{
		echo "Gagal";
	}
	
?>